package com.tddx.activiti.business.sys.service.systmenu;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.tddx.activiti.business.sys.dao.systmenu.SysTmenuDao;
import com.tddx.activiti.business.sys.dao.systmenu.SysTmenuJdbc;
import com.tddx.activiti.business.sys.entity.systmenu.SysTmenuEntity;

/**
 * service layer 服务层 
 * @Auth yanweizhao 
*/
@Service
public class SysTmenuService {

	@Autowired private SysTmenuDao dao;

	@Autowired private SysTmenuJdbc jdbc;

	public SysTmenuEntity findOne(Long id){
		SysTmenuEntity entity = dao.findOne(id);
		return entity;
	}
	
	public SysTmenuEntity save(SysTmenuEntity entity){
		entity = dao.saveAndFlush(entity);
		return entity;
	}
	
	public void delete(String ids){
		for(String idStr: ids.split(",")){
			Long id = Long.valueOf(idStr);
			SysTmenuEntity entity = dao.findOne(id);
			entity.setVcDel("1");
		}
	}
	
	public Object findList(){
		Object obj = jdbc.findListByCondition();
		return obj;
	}
	
	
}
